import Vue from 'vue';
import App from './App.vue';

import router from '@/router';
import store from '@/store';

// 引入mockserve.js---mock数据
import '@/mock/mockServe';
// 引入swiper样式
import 'swiper/css/swiper.css';

// 引入element-ui的MessageBox
import { MessageBox } from 'element-ui';

import VueLazyload from 'vue-lazyload';

// 懒加载
import aaa from '@/assets/1.gif';
Vue.use(VueLazyload, {
	// 懒加载默认的图片
	loading: aaa
});

// 使用表单验证插件
import '@/plugins/validate.js';

// 全局组件
import TypeNav from '@/pages/Home/TypeNav';
// 轮播图
import Carousel from '@/components/Carousel';
// 分页器
import Pagination from '@/components/pagination';
Vue.component('TypeNav', TypeNav);
Vue.component('Carousel', Carousel);
Vue.component('Pagination', Pagination);

Vue.config.productionTip = false;
Vue.prototype.$bus = new Vue();

Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

new Vue({
	router,
	store,
	render: h => h(App)
}).$mount('#app');
